﻿@page "/toast"
@inject ToastService toast
<h3>ToastUsing</h3>
<p>
    在 MainLayout.razor 添加 <br />
    <code>
        &lt;Toasts class="p-3" AutoHide="true" Delay="5000" Placement="ToastsPlacement.BottomRight" /&gt;
    </code>
</p>
<Button Color="ButtonColor.Primary" @onclick="ShowToast">Show Toast</Button>

@code {
    private void ShowToast()
    {
        toast.Notify(new ToastMessage
            {
                Type = ToastType.Success,
                Title = "Title",
                Message = "这是 Toast",
                HelpText = $"{DateTime.Now}"
            });
    }
}
